class Solution {
public:
    bool increasingTriplet(vector<int>& nums) {
        int n=nums.size();
        int a=nums[0],b=INT_MAX;
        for(int i=1;i<n;i++)
        {
            if(nums[i]>b)return true;
            else if(nums[i]>a)b=nums[i];
            else if(nums[i]<=a)a=nums[i];
        }
        return false;
    }
};
